package com.example.courselab.common

import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.example.courselab.ui.feature.home.HomeScreen
import com.example.courselab.ui.feature.login.LoginScreen

@Composable
fun NavMap(navController: NavHostController) {
    NavHost(navController=navController, startDestination = "home") {
        composable("login") {
            LoginScreen(onLoginSuccess = {
                navController.navigate("home") {
                    popUpTo(0)
                }
            })
        }
        composable("home") {
            HomeScreen(navController)
        }
    }
}